﻿using WYD.Common;

namespace WYD.UnitTest;

public class Tests
{
    [SetUp]
    public void Setup()
    {
    }

    [Test]
    public void Test1()
    {
        var keyPair = Tools.CreateKeyPairRSA(2048);
        Console.WriteLine(keyPair.PrivatePem);
        var privatePem = keyPair.PrivatePem;
        Console.WriteLine(keyPair.PublicPem);
        var publicPem = keyPair.PublicPem;
        var encryptedStr = Tools.EncryptRSA(publicPem!, "123456");
        Console.WriteLine(encryptedStr);
        var decryptedStr = Tools.DecryptRSA(privatePem!, encryptedStr);
        Console.WriteLine(decryptedStr);
        // Assert.Pass();
    }
    
    [Test]
    public void Test2()
    { 
        var input = "Hello, BouncyCastle!";
        var inputMd5 = Tools.GetMd5Hash(input);
        Console.WriteLine(inputMd5);
    }
}